PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Defining Inheritance

Inheritance is the ability of a child script object to take on the properties and handlers of a parent script object. You specify inheritance with the Parent property. A script object that includes a Parent property inherits the properties and handlers of the script object listed in the Parent property.

The script object listed in a Parent property definition is called the parent script object, or parent. A script object that includes a Parent property is referred to as a child script object, or child. The Parent property is not required. A script object can have many children, but a child script object can have only one parent.

The syntax for defining a parent script object is

( property | prop ) parent : variable

where

variable is a variable that contains the parent script object.

A script object must be initialized before it can be assigned as a parent of another script object. This means that the definition of the parent script object (or a command that calls a function that creates the parent script object) must come before the definition of the child in the same script.


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)